package cn.com.xyc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.xyc.dao.AdminMapper;
import cn.com.xyc.pojo.Admin;
import cn.com.xyc.pojo.AdminExample;
import cn.com.xyc.service.SystemService;

@Service
public class SystemServiceImpl implements SystemService {
	@Autowired
	private AdminMapper adminMapper;

	public Admin findByUsername(String username) {
		AdminExample example = new AdminExample();
		example.createCriteria().andUsernameEqualTo(username);
		List<Admin> list = adminMapper.selectByExample(example);
		if (list != null && list.size() > 0)
			return list.get(0);
		return null;
	}
}
